/*点击图片预览放大效果*/
.viewer-container{
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  opacity: 0;
  transition: all .3s;
  z-index: 2015;
  background-color: rgba(0, 0, 0, .5);
  touch-action: none;
  user-select: none;
  &.fade-in{
    opacity: 1
  }
  .viewer-close{
    background-color: red;
    border-radius: 50%;
    cursor: pointer;
    height: 80px;
    overflow: hidden;
    position: absolute;
    right: -40px;
    top: -40px;
    transition: background-color .15s;
    width: 80px;
    font-size: 26px;
    z-index: 12;
    &:before{
      font-size: 18px;
      color: #fff;
      position: absolute;
      left: 15px;
      top: 42px;
      display: block
    }
  }
  .viewer-footer{
    bottom: 0;
    left: 0;
    overflow: hidden;
    position: absolute;
    right: 0;
    text-align: center;
    z-index: 11;
  }
  .viewer-navbar{
    background-color: rgba(0, 0, 0, .5);
    overflow-y: hidden;
    overflow-x: auto;
    // height: 50px;
    text-align: center;
    z-index: 10;
    ul {
      display: flex;
    }
    li{
      color: transparent;
      cursor: pointer;
      display: inline-block;
      vertical-align: middle;
      margin: 0 1px;
      font-size: 0;
      height: 50px;
      line-height: 0;
      opacity: .5;
      overflow: hidden;
      transition: opacity .15s;
      width: 30px;
      min-width: 30px;
      &.active{
        opacity: 1
      }
      img{
        width: 100%;
        height: 100%;
      }
    }
  }
  .viewer-canvas{
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    img{
      transition: all .3s;
      max-width: 100%;
      max-height: 100%
    }
    &.loading{
      img{
        animation: img-zoom-out .3s forwards
      }
      &:before{
        content: '';
        display: block;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        border: 4px solid hsla(0, 0%, 100%, .1);
        border-left-color: hsla(0, 0%, 100%, .5);
        animation: viewer-spinner 1s linear infinite;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        position: absolute
      }
    }
    &.an{
      img{
        animation: img-zoom-in .3s
      }
    }
  }
  .viewer-toolbar{
    ul{
      display: inline-block;
      margin: 0 auto 5px;
      overflow: hidden;
      padding: 3px 0;
    }
    li{
      background-color: rgba(0, 0, 0, .5);
      border-radius: 50%;
      cursor: pointer;
      float: left;
      height: 24px;
      overflow: hidden;
      transition: background-color .15s;
      margin: 0 1px;
      width: 24px;
      background-image: url("")
    }
    .viewer-prev{
      background-position: -79px 1px;
    }
    .viewer-next{
      background-position: -118px 1px;
    }
    .viewer-rotate-left{
      background-position: -138px 2px;
    }
    .viewer-rotate-right{
      background-position: -158px 2px;
    }
    .viewer-zoom-in{
      background-position: 2px 2px;
    }
    .viewer-zoom-out{
      background-position: -18px 2px;
    }
    .viewer-one-to-one{
      background-position: -38px 2px;
    }
  }
  .mask{
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
  }
}
@keyframes viewer-spinner{
  0%{
    transform: rotate(0deg)
  }
  100%{
    transform: rotate(360deg)
  }
}
@keyframes img-zoom-out{
  0%{
    transform: scale(1)
  }
  100%{
    transform: scale(0)
  }
}
@keyframes img-zoom-in{
  0%{
    transform: scale(0)
  }
  100%{
    transform: scale(1)
  }
}